import java.util.Arrays;
import java.util.Scanner;

public class Test {
    public static void main2(String[] args) {
        Scanner in = new Scanner(System.in);
        String str = in.nextLine();
        String s = str.toUpperCase();
        String[] arr = str.split(" ");
        StringBuilder stringBuilder = new StringBuilder();
        for(int i = 0; i < arr.length; i++) {
            stringBuilder.append(arr[i].charAt(0));
        }
        System.out.println(stringBuilder);
    }

    public static void main1(String[] args) {
        String str = "hello world";
        str.split(" ");
    }

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int k = in.nextInt();
        int[] arr = new int[n];
        for(int i = 0; i < n; i++) {
            arr[i] = in.nextInt();
        }
        Arrays.sort(arr);
        int sum = 0;
        for(int i = n - 1; i >= 0; i--) {
            while(k != 0 && arr[i] % 2 == 0 && (i == 0 || arr[i] > arr[i-1])) {
                arr[i] /= 2;
                k--;
            }
            sum += arr[i];
        }
        System.out.println(sum);
    }
}
